<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Zookeeper class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.zookeeper-dispatch.html">« zookeeper_dispatch</a></li>
      <li style="float: right;"><a href="zookeeper.addauth.html">Zookeeper::addAuth »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.zookeeper.html">ZooKeeper</a></li>
    <li>The Zookeeper class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.zookeeper" class="reference">
 <h1 class="title">The Zookeeper class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PECL zookeeper &gt;= 0.1.0)</p>
 

  <div class="section" id="zookeeper.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    Represents ZooKeeper session.
   </p>
  </div>

 
  <div class="section" id="zookeeper.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Zookeeper</strong>
     </span>
 
     {</div>

 

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$host</code><span class="initializer"> = &#039;&#039;</span></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$recv_timeout</code><span class="initializer"> = 10000</span></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.addauth.html" class="methodname">addAuth</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$scheme</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$cert</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$completion_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.close.html" class="methodname">close</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.connect.html" class="methodname">connect</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$host</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$recv_timeout</code><span class="initializer"> = 10000</span></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.create.html" class="methodname">create</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter">$acls</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = <strong><code>null</code></strong></span></span><br>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.delete.html" class="methodname">delete</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$version</code><span class="initializer"> = -1</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.exists.html" class="methodname">exists</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.get.html" class="methodname">get</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$stat</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$max_size</code><span class="initializer"> = 0</span></span><br>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getacl.html" class="methodname">getAcl</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getchildren.html" class="methodname">getChildren</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getclientid.html" class="methodname">getClientId</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getconfig.html" class="methodname">getConfig</a></span>(): <span class="type"><a href="class.zookeeperconfig.html" class="type ZookeeperConfig">ZookeeperConfig</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getrecvtimeout.html" class="methodname">getRecvTimeout</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.getstate.html" class="methodname">getState</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.isrecoverable.html" class="methodname">isRecoverable</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.set.html" class="methodname">set</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$version</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$stat</code><span class="initializer"> = <strong><code>null</code></strong></span></span><br>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.setacl.html" class="methodname">setAcl</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$version</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$acl</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="methodname"><a href="zookeeper.setdebuglevel.html" class="methodname">setDebugLevel</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$logLevel</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="methodname"><a href="zookeeper.setdeterministicconnorder.html" class="methodname">setDeterministicConnOrder</a></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$yesOrNo</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.setlogstream.html" class="methodname">setLogStream</a></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="zookeeper.setwatcher.html" class="methodname">setWatcher</a></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code></span>): <span class="type">bool</span></div>




    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-read"><var class="varname">PERM_READ</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-write"><var class="varname">PERM_WRITE</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-create"><var class="varname">PERM_CREATE</var></a></var><span class="initializer"> = 4</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-delete"><var class="varname">PERM_DELETE</var></a></var><span class="initializer"> = 8</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-admin"><var class="varname">PERM_ADMIN</var></a></var><span class="initializer"> = 16</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.perm-all"><var class="varname">PERM_ALL</var></a></var><span class="initializer"> = 31</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.ephemeral"><var class="varname">EPHEMERAL</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.sequence"><var class="varname">SEQUENCE</var></a></var><span class="initializer"> = 2</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.log-level-error"><var class="varname">LOG_LEVEL_ERROR</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.log-level-warn"><var class="varname">LOG_LEVEL_WARN</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.log-level-info"><var class="varname">LOG_LEVEL_INFO</var></a></var><span class="initializer"> = 3</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.log-level-debug"><var class="varname">LOG_LEVEL_DEBUG</var></a></var><span class="initializer"> = 4</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.expired-session-state"><var class="varname">EXPIRED_SESSION_STATE</var></a></var><span class="initializer"> = -112</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.auth-failed-state"><var class="varname">AUTH_FAILED_STATE</var></a></var><span class="initializer"> = -113</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.connecting-state"><var class="varname">CONNECTING_STATE</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.associating-state"><var class="varname">ASSOCIATING_STATE</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.connected-state"><var class="varname">CONNECTED_STATE</var></a></var><span class="initializer"> = 3</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.readonly-state"><var class="varname">READONLY_STATE</var></a></var><span class="initializer"> = 5</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.notconnected-state"><var class="varname">NOTCONNECTED_STATE</var></a></var><span class="initializer"> = 999</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.created-event"><var class="varname">CREATED_EVENT</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.deleted-event"><var class="varname">DELETED_EVENT</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.changed-event"><var class="varname">CHANGED_EVENT</var></a></var><span class="initializer"> = 3</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.child-event"><var class="varname">CHILD_EVENT</var></a></var><span class="initializer"> = 4</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.session-event"><var class="varname">SESSION_EVENT</var></a></var><span class="initializer"> = -1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.notwatching-event"><var class="varname">NOTWATCHING_EVENT</var></a></var><span class="initializer"> = -2</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.systemerror"><var class="varname">SYSTEMERROR</var></a></var><span class="initializer"> = -1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.runtimeinconsistency"><var class="varname">RUNTIMEINCONSISTENCY</var></a></var><span class="initializer"> = -2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.datainconsistency"><var class="varname">DATAINCONSISTENCY</var></a></var><span class="initializer"> = -3</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.connectionloss"><var class="varname">CONNECTIONLOSS</var></a></var><span class="initializer"> = -4</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.marshallingerror"><var class="varname">MARSHALLINGERROR</var></a></var><span class="initializer"> = -5</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.unimplemented"><var class="varname">UNIMPLEMENTED</var></a></var><span class="initializer"> = -6</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.operationtimeout"><var class="varname">OPERATIONTIMEOUT</var></a></var><span class="initializer"> = -7</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.badarguments"><var class="varname">BADARGUMENTS</var></a></var><span class="initializer"> = -8</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.invalidstate"><var class="varname">INVALIDSTATE</var></a></var><span class="initializer"> = -9</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.newconfignoquorum"><var class="varname">NEWCONFIGNOQUORUM</var></a></var><span class="initializer"> = -13</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.reconfiginprogress"><var class="varname">RECONFIGINPROGRESS</var></a></var><span class="initializer"> = -14</span>;</div>


    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.ok"><var class="varname">OK</var></a></var><span class="initializer"> = 0</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.apierror"><var class="varname">APIERROR</var></a></var><span class="initializer"> = -100</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.nonode"><var class="varname">NONODE</var></a></var><span class="initializer"> = -101</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.noauth"><var class="varname">NOAUTH</var></a></var><span class="initializer"> = -102</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.badversion"><var class="varname">BADVERSION</var></a></var><span class="initializer"> = -103</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.nochildrenforephemerals"><var class="varname">NOCHILDRENFOREPHEMERALS</var></a></var><span class="initializer"> = -108</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.nodeexists"><var class="varname">NODEEXISTS</var></a></var><span class="initializer"> = -110</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.notempty"><var class="varname">NOTEMPTY</var></a></var><span class="initializer"> = -111</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.sessionexpired"><var class="varname">SESSIONEXPIRED</var></a></var><span class="initializer"> = -112</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.invalidcallback"><var class="varname">INVALIDCALLBACK</var></a></var><span class="initializer"> = -113</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.invalidacl"><var class="varname">INVALIDACL</var></a></var><span class="initializer"> = -114</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.authfailed"><var class="varname">AUTHFAILED</var></a></var><span class="initializer"> = -115</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.closing"><var class="varname">CLOSING</var></a></var><span class="initializer"> = -116</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.nothing"><var class="varname">NOTHING</var></a></var><span class="initializer"> = -117</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.sessionmoved"><var class="varname">SESSIONMOVED</var></a></var><span class="initializer"> = -118</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.notreadonly"><var class="varname">NOTREADONLY</var></a></var><span class="initializer"> = -119</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.ephemeralonlocalsession"><var class="varname">EPHEMERALONLOCALSESSION</var></a></var><span class="initializer"> = -120</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.nowatcher"><var class="varname">NOWATCHER</var></a></var><span class="initializer"> = -121</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.zookeeper.html#zookeeper.class.constants.reconfigdisabled"><var class="varname">RECONFIGDISABLED</var></a></var><span class="initializer"> = -122</span>;</div>



   }</div>


  </div>


  <div class="section" id="zookeeper.class.constants">
   <h2 class="title">预定义常量</h2>


   <div class="section" id="zookeeper.class.constants.perms">
    <h2 class="title"><abbr>ZooKeeper</abbr> Permissions</h2>
    <dl>

     
      <dt id="zookeeper.class.constants.perm-read"><strong><code>Zookeeper::PERM_READ</code></strong></dt>

      <dd>

       <p class="para">Can read nodes value and list its children</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.perm-write"><strong><code>Zookeeper::PERM_WRITE</code></strong></dt>

      <dd>

       <p class="para">Can set the nodes value</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.perm-create"><strong><code>Zookeeper::PERM_CREATE</code></strong></dt>

      <dd>

       <p class="para">Can create children</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.perm-delete"><strong><code>Zookeeper::PERM_DELETE</code></strong></dt>

      <dd>

       <p class="para">Can delete children</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.perm-admin"><strong><code>Zookeeper::PERM_ADMIN</code></strong></dt>

      <dd>

       <p class="para">Can execute set_acl()</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.perm-all"><strong><code>Zookeeper::PERM_ALL</code></strong></dt>

      <dd>

       <p class="para">All of the above flags ORd together</p>
      </dd>

     

    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.create-flags">
    <h2 class="title"><abbr>ZooKeeper</abbr> Create Flags</h2>
    <dl>

     
      <dt id="zookeeper.class.constants.ephemeral"><strong><code>Zookeeper::EPHEMERAL</code></strong></dt>

      <dd>

       <p class="para">If Zookeeper::EPHEMERAL flag is set, the node will automatically get removed if the client session goes away.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.sequence"><strong><code>Zookeeper::SEQUENCE</code></strong></dt>

      <dd>

       <p class="para">If the Zookeeper::SEQUENCE flag is set, a unique monotonically increasing sequence number is appended to the path name. The sequence number is always fixed length of 10 digits, 0 padded.</p>
      </dd>

     
    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.log-levels">
    <h2 class="title"><abbr>ZooKeeper</abbr> Log Levels</h2>
    <dl>

     
      <dt id="zookeeper.class.constants.log-level-error"><strong><code>Zookeeper::LOG_LEVEL_ERROR</code></strong></dt>

      <dd>

       <p class="para">Outputs only error mesages</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.log-level-warn"><strong><code>Zookeeper::LOG_LEVEL_WARN</code></strong></dt>

      <dd>

       <p class="para">Outputs errors/warnings</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.log-level-info"><strong><code>Zookeeper::LOG_LEVEL_INFO</code></strong></dt>

      <dd>

       <p class="para">Outputs big action messages besides errors/warnings</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.log-level-debug"><strong><code>Zookeeper::LOG_LEVEL_DEBUG</code></strong></dt>

      <dd>

       <p class="para">Outputs all</p>
      </dd>

     

    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.states">
    <h2 class="title"><abbr>ZooKeeper</abbr> States</h2>
    <dl>

     
      <dt id="zookeeper.class.constants.expired-session-state"><strong><code>Zookeeper::EXPIRED_SESSION_STATE</code></strong></dt>

      <dd>

       <p class="para">Connected but session expired</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.auth-failed-state"><strong><code>Zookeeper::AUTH_FAILED_STATE</code></strong></dt>

      <dd>

       <p class="para">Connected but auth failed</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.connecting-state"><strong><code>Zookeeper::CONNECTING_STATE</code></strong></dt>

      <dd>

       <p class="para">Connecting</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.associating-state"><strong><code>Zookeeper::ASSOCIATING_STATE</code></strong></dt>

      <dd>

       <p class="para">Associating</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.connected-state"><strong><code>Zookeeper::CONNECTED_STATE</code></strong></dt>

      <dd>

       <p class="para">Connected</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.readonly-state"><strong><code>Zookeeper::READONLY_STATE</code></strong></dt>

      <dd>

       <p class="para">TODO: help us improve this extension.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.notconnected-state"><strong><code>Zookeeper::NOTCONNECTED_STATE</code></strong></dt>

      <dd>

       <p class="para">Connection failed</p>
      </dd>

     

    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.watch-types">
    <h2 class="title"><abbr>ZooKeeper</abbr> Watch Types</h2>
    <dl>

     
      <dt id="zookeeper.class.constants.created-event"><strong><code>Zookeeper::CREATED_EVENT</code></strong></dt>

      <dd>

       <p class="para">A node has been created</p>
       <p class="para">This is only generated by watches on non-existent nodes. These watches are set using Zookeeper::exists.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.deleted-event"><strong><code>Zookeeper::DELETED_EVENT</code></strong></dt>

      <dd>

       <p class="para">A node has been deleted</p>
       <p class="para">This is only generated by watches on nodes. These watches are set using Zookeeper::exists and Zookeeper::get.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.changed-event"><strong><code>Zookeeper::CHANGED_EVENT</code></strong></dt>

      <dd>

       <p class="para">A node has changed</p>
       <p class="para">This is only generated by watches on nodes. These watches are set using Zookeeper::exists and Zookeeper::get.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.child-event"><strong><code>Zookeeper::CHILD_EVENT</code></strong></dt>

      <dd>

       <p class="para">A change as occurred in the list of children</p>
       <p class="para">This is only generated by watches on the child list of a node. These watches are set using Zookeeper::getChildren.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.session-event"><strong><code>Zookeeper::SESSION_EVENT</code></strong></dt>

      <dd>

       <p class="para">A session has been lost</p>
       <p class="para">This is generated when a client loses contact or reconnects with a server.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.notwatching-event"><strong><code>Zookeeper::NOTWATCHING_EVENT</code></strong></dt>

      <dd>

       <p class="para">A watch has been removed</p>
       <p class="para">This is generated when the server for some reason, probably a resource constraint, will no longer watch a node for a client.</p>
      </dd>

     

    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.system-n-server-side-errors">
    <h2 class="title"><abbr>ZooKeeper</abbr> System and Server-side Errors</h2>
    <dl>
     
      <dt id="zookeeper.class.constants.systemerror"><strong><code>Zookeeper::SYSTEMERROR</code></strong></dt>

      <dd>

       <p class="para">This is never thrown by the server, it shouldn&#039;t be used other than to indicate a range. Specifically error codes greater than this value, but lesser than Zookeeper::APIERROR, are system errors.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.runtimeinconsistency"><strong><code>Zookeeper::RUNTIMEINCONSISTENCY</code></strong></dt>

      <dd>

       <p class="para">A runtime inconsistency was found.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.datainconsistency"><strong><code>Zookeeper::DATAINCONSISTENCY</code></strong></dt>

      <dd>

       <p class="para">A data inconsistency was found.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.connectionloss"><strong><code>Zookeeper::CONNECTIONLOSS</code></strong></dt>

      <dd>

       <p class="para">Connection to the server has been lost.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.marshallingerror"><strong><code>Zookeeper::MARSHALLINGERROR</code></strong></dt>

      <dd>

       <p class="para">Error while marshalling or unmarshalling data.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.unimplemented"><strong><code>Zookeeper::UNIMPLEMENTED</code></strong></dt>

      <dd>

       <p class="para">Operation is unimplemented.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.operationtimeout"><strong><code>Zookeeper::OPERATIONTIMEOUT</code></strong></dt>

      <dd>

       <p class="para">Operation timeout.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.badarguments"><strong><code>Zookeeper::BADARGUMENTS</code></strong></dt>

      <dd>

       <p class="para">Invalid arguments.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.invalidstate"><strong><code>Zookeeper::INVALIDSTATE</code></strong></dt>

      <dd>

       <p class="para">Invliad zhandle state.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.newconfignoquorum"><strong><code>Zookeeper::NEWCONFIGNOQUORUM</code></strong></dt>

      <dd>

       <p class="para">No quorum of new config is connected and up-to-date with the leader of last committed config - try invoking reconfiguration after new servers are connected and synced.</p>
       <p class="para">Available as of ZooKeeper 3.5.0</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.reconfiginprogress"><strong><code>Zookeeper::RECONFIGINPROGRESS</code></strong></dt>

      <dd>

       <p class="para">Reconfiguration requested while another reconfiguration is currently in progress. This is currently not supported. Please retry.</p>
       <p class="para">Available as of ZooKeeper 3.5.0</p>
      </dd>

     
    </dl>

   </div>



   <div class="section" id="zookeeper.class.constants.api-errors">
    <h2 class="title"><abbr>ZooKeeper</abbr> API Errors</h2>
    <dl>
     
      <dt id="zookeeper.class.constants.ok"><strong><code>Zookeeper::OK</code></strong></dt>

      <dd>

       <p class="para">Everything is OK.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.apierror"><strong><code>Zookeeper::APIERROR</code></strong></dt>

      <dd>

       <p class="para">This is never thrown by the server, it shouldn&#039;t be used other than to indicate a range. Specifically error codes greater than this value are API errors (while values less than this indicate a Zookeeper::SYSTEMERROR).</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.nonode"><strong><code>Zookeeper::NONODE</code></strong></dt>

      <dd>

       <p class="para">Node does not exist.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.noauth"><strong><code>Zookeeper::NOAUTH</code></strong></dt>

      <dd>

       <p class="para">Not authenticated.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.badversion"><strong><code>Zookeeper::BADVERSION</code></strong></dt>

      <dd>

       <p class="para">Version conflict.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.nochildrenforephemerals"><strong><code>Zookeeper::NOCHILDRENFOREPHEMERALS</code></strong></dt>

      <dd>

       <p class="para">Ephemeral nodes may not have children.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.nodeexists"><strong><code>Zookeeper::NODEEXISTS</code></strong></dt>

      <dd>

       <p class="para">The node already exists.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.notempty"><strong><code>Zookeeper::NOTEMPTY</code></strong></dt>

      <dd>

       <p class="para">The node has children.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.sessionexpired"><strong><code>Zookeeper::SESSIONEXPIRED</code></strong></dt>

      <dd>

       <p class="para">The session has been expired by the server.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.invalidcallback"><strong><code>Zookeeper::INVALIDCALLBACK</code></strong></dt>

      <dd>

       <p class="para">Invalid callback specified.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.invalidacl"><strong><code>Zookeeper::INVALIDACL</code></strong></dt>

      <dd>

       <p class="para">Invalid ACL specified.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.authfailed"><strong><code>Zookeeper::AUTHFAILED</code></strong></dt>

      <dd>

       <p class="para">Client authentication failed.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.closing"><strong><code>Zookeeper::CLOSING</code></strong></dt>

      <dd>

       <p class="para">ZooKeeper is closing.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.nothing"><strong><code>Zookeeper::NOTHING</code></strong></dt>

      <dd>

       <p class="para">(not error) No server responses to process.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.sessionmoved"><strong><code>Zookeeper::SESSIONMOVED</code></strong></dt>

      <dd>

       <p class="para">Session moved to another server, so operation is ignored.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.notreadonly"><strong><code>Zookeeper::NOTREADONLY</code></strong></dt>

      <dd>

       <p class="para">State-changing request is passed to read-only server.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.ephemeralonlocalsession"><strong><code>Zookeeper::EPHEMERALONLOCALSESSION</code></strong></dt>

      <dd>

       <p class="para">Attempt to create ephemeral node on a local session.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.nowatcher"><strong><code>Zookeeper::NOWATCHER</code></strong></dt>

      <dd>

       <p class="para">The watcher couldn&#039;t be found.</p>
      </dd>

     
     
      <dt id="zookeeper.class.constants.reconfigdisabled"><strong><code>Zookeeper::RECONFIGDISABLED</code></strong></dt>

      <dd>

       <p class="para">Attempts to perform a reconfiguration operation when reconfiguration feature is disabled.</p>
      </dd>

     
    </dl>

   </div>


  </div>


 
 </div>
 
 



















































































































































 
<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="zookeeper.addauth.html">Zookeeper::addAuth</a> — Specify application credentials</li><li><a href="zookeeper.close.html">Zookeeper::close</a> — Close the zookeeper handle and free up any resources</li><li><a href="zookeeper.connect.html">Zookeeper::connect</a> — Create a handle to used communicate with zookeeper</li><li><a href="zookeeper.construct.html">Zookeeper::__construct</a> — Create a handle to used communicate with zookeeper</li><li><a href="zookeeper.create.html">Zookeeper::create</a> — Create a node synchronously</li><li><a href="zookeeper.delete.html">Zookeeper::delete</a> — Delete a node in zookeeper synchronously</li><li><a href="zookeeper.exists.html">Zookeeper::exists</a> — Checks the existence of a node in zookeeper synchronously</li><li><a href="zookeeper.get.html">Zookeeper::get</a> — Gets the data associated with a node synchronously</li><li><a href="zookeeper.getacl.html">Zookeeper::getAcl</a> — Gets the acl associated with a node synchronously</li><li><a href="zookeeper.getchildren.html">Zookeeper::getChildren</a> — Lists the children of a node synchronously</li><li><a href="zookeeper.getclientid.html">Zookeeper::getClientId</a> — Return the client session id, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE)</li><li><a href="zookeeper.getconfig.html">Zookeeper::getConfig</a> — Get instance of ZookeeperConfig</li><li><a href="zookeeper.getrecvtimeout.html">Zookeeper::getRecvTimeout</a> — Return the timeout for this session, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE). This value may change after a server re-connect</li><li><a href="zookeeper.getstate.html">Zookeeper::getState</a> — Get the state of the zookeeper connection</li><li><a href="zookeeper.isrecoverable.html">Zookeeper::isRecoverable</a> — Checks if the current zookeeper connection state can be recovered</li><li><a href="zookeeper.set.html">Zookeeper::set</a> — Sets the data associated with a node</li><li><a href="zookeeper.setacl.html">Zookeeper::setAcl</a> — Sets the acl associated with a node synchronously</li><li><a href="zookeeper.setdebuglevel.html">Zookeeper::setDebugLevel</a> — Sets the debugging level for the library</li><li><a href="zookeeper.setdeterministicconnorder.html">Zookeeper::setDeterministicConnOrder</a> — Enable/disable quorum endpoint order randomization</li><li><a href="zookeeper.setlogstream.html">Zookeeper::setLogStream</a> — Sets the stream to be used by the library for logging</li><li><a href="zookeeper.setwatcher.html">Zookeeper::setWatcher</a> — Set a watcher function</li></ul>
</div>
</div></div></body></html>